/* @author: seagull  @change:每个星星被消除时，得分往上移动到指定位置，并消失
 * @date: 2024/10/12 09:52 */

cc.Class({
    extends: cc.Component,

    properties: {

    },
    //得分，时间，位置
    init:function(curScore,curTime,curPos){
        this.node.getComponent(cc.Label).string = curScore;
        let act_1 =cc.tween(this.node).to(curTime + 0.1,{position:curPos});
        let act_2 = cc.tween(this.node).to(curTime +0.1,{scale:0.2});

        cc.tween(this.node)
            .parallel
            (
                act_1,act_2
            )
            .call(()=>{
                this.node.destroy();
                starGame.addScore(curScore);
            })
        .start();

    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {

    },

    // update (dt) {},
});
